<template>
	<div class="invite-rule">
		<h2 class="bold pl15 pr15 pt15 pb15 align-center block">{{ data.title }}</h2>
		<div class="" v-html="data.content">
			
		</div>
	</div>
</template>

<script>
	export default{
		data()
		{
			return{
				data : [],
				rule_id : this.$route.query.id, 
			}
		},
		created()
		{
			this.loadData();
		},
		methods:
		{
			loadData()
			{
				switch(this.rule_id)
				{
					case 'point':
						this.$http.get('/article/getone',{ params:{ article: this.rule_id } }).then(res => {
							this.data = res.data;
						})
						return new Promise(() => {});

					case 'help':
						this.$http.get('/info/help',{ params:{ article_id	: this.$route.query.article_id } }).then(res => {
							this.data = res.data;
						})
						return new Promise(() => {});
							
					default:
						this.$http.get('/Article/getArticle',{ params:{ article : this.rule_id } }).then(res => {
							this.data = res.data;
						})
						return new Promise(() => {});
				}
			}
		}
	}
</script>